<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
    <div id="app">
        <h1>你有多少小迷妹</h1>
        <input type="radio"  @click="value='10000'" >10000以上
        <input type="radio"  @click="value='5000-10000'" >5000-10000以内
        <input type="radio"  @click="value='5000'" >5000以下
        结果:<input type="text" v-model="value"><br>
        <button @click="add">点我增加</button>
        <button @click="sub">点我减少</button>
        <input type="text" v-model="num">个铁杆粉丝
       <h1>{{hello}}</h1>
    </div>
</body>
<script src="./node_modules/vue/dist/vue.js"></script>
<script type="text/javascript">
    var vm = new Vue({
        el:"#app",
        data:{
            value:"",
            num:1,
            hello:""
        },
        created(){
            this.hello = "hello, world！ 我出生了！";
            console.log(this);
        },
        methods:{
            add:function(){
                // this代表的当前vue实例
                this.num++;
            },
            sub:function(){
               if (this.num > 1){
                   this.num--;
               }
            }
        }
    });

</script>
</html>